#include <iostream>
#include "../../comlink/link/link.h"
#include "../../comlink/linkslist/linkslist.h"


int main(int argc, char ** argv)
{
  // Links for testing pointer
  Link * testLinkA;
  Link * testLinkB;

  bool * tempLinkBuff;
  
  int outerLoop, innerLoop;

  // Create a linked list for holding the physical links
  LinksList * linkHolder = new LinksList();

  // Create the Link with a physical link
  tempLinkBuff = linkHolder->CreateNewLink();

  // Initialize links
  testLinkA = new Link(tempLinkBuff);
  testLinkB = new Link(tempLinkBuff);

  // set link label values
  testLinkA->SetTargetLabel(0x00000001);
  testLinkB->SetTargetLabel(11);


  for(int outLoop = 0; outLoop < 32; outLoop++)
  {
    for(int inLoop = 0; inLoop < 12; inLoop++)
    {
      testLinkA->ClockLink();
      testLinkB->ClockLink();
    }

    std::cout << std::endl << "**Printing Link A**";
    testLinkA->PrintLinkData();

    std::cout << std::endl << "**Printing Link B**";
    testLinkB->PrintLinkData();
  }


  // Destroy all the physical links
  linkHolder->DestroyAllLinks();

  // Destroy Links and Linked List
  delete testLinkA;
  delete testLinkB;
  delete linkHolder;

  return 1;
}
